import request from '@/utils/request'

export function getTreeList () {
  return request({
    url: '/company/department',
    method: 'get'
  })
}

export function deleteDepartments (id) {
  return request({
    url: `/company/department/${id}`,
    method: 'delete'
  })
}

export function addDepartments (data) {
  return request({
    url: `/company/department`,
    method: 'post',
    data
  })
}

export function putDepartments (id) {
  return request({
    url: `/company/department/${id}`,
    method: 'put'
  })
}

export function getDepartmentsApi (id) {
  return request({
    url: `/company/department/${id}`,
    method: 'get'
  })
}

export function getAllRole () {
  return request({
    url: '/sys/role',
    method: 'get'
  })
}
